<?php
class Product_Model_ProductOptions
{
	protected $_table;
	public function __construct(){
		$this->_table = new Product_Model_DbTable_ProductOptions();
	}
	
	
	/**
	* 获得所有选项
	* @return zend_db_table_rowset
	*/
	public function getAll(){
		return $this->_table->fetchAll(null,null,"po_sort_id ASC");
	}
	
	public function getDbTable(){
		return $this->_table;
	}
	
	public function getByName($name){
		$select = $this->_table->select()->where("po_name = ?",$name);
		return $this->_table->fetchRow($select);
	}
	public function getById($id){
		$select = $this->_table->select()->where("po_id = ?",$id);
		return $this->_table->fetchRow($select);
	}
}